package com.bqtv.sport.ui.mine

import android.content.Context
import android.content.Intent
import android.view.View
import com.bqtv.sport.app.AppActivity
import com.bqtv.sport.bean.ProvinceBean
import com.bqtv.sport.databinding.ActivityAddAddressBinding
import com.bqtv.sport.dialog.SelectCityDialog


class AddAddressActivity : AppActivity<ActivityAddAddressBinding>() {
    companion object {
        fun start(context: Context) {
            val intent = Intent(context, AddAddressActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun getViewBinding() = ActivityAddAddressBinding.inflate(layoutInflater)

    override fun initView() {

    }

    override fun initData() {


        initListener()
    }

    private fun initListener() {
        binding.llAddress.setOnClickListener(this)
    }

    override fun onClick(view: View) {
        super.onClick(view)
        when (view) {
            binding.llAddress -> {
                var cityDialog = SelectCityDialog.Builder(this)
                cityDialog.clickResult = object : SelectCityDialog.Builder.ClickResult {
                    override fun onAddressClick(
                        provinceBean: ProvinceBean,
                        cityBean: ProvinceBean,
                        areaBean: ProvinceBean
                    ) {
                        toast(provinceBean.name + "-" + cityBean.name + "-" + areaBean.name)
                    }

                }
                cityDialog.show()
            }

        }
    }
}